﻿Imports System.Text
Imports System.IO

Public Class w0005
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim sb As New StringBuilder
        Dim tmpS As String = ""
        Dim t As Integer = 0, m As Integer = 0, tp As Integer = 0
        Dim t_start As Integer = Val(ComboBox1.Text)

        For i = 0 + t_start To general_Ubound
            t = tj_xingtaicount(i - t_start, i - 1, ComboBox2.Text)
            If t >= 30 Then

                For j = i To general_Ubound
                    Debug.Print(arrJH_S(j))
                    For k = 0 To 4
                        If arrJH_sep_I(j, k) < 5 Then
                            m = m + 1
                        End If
                    Next
                    If m <= 2 Then
                        Exit For
                    Else
                        tp = tp + 1
                    End If
                    m = 0
                Next
            End If
            sb.Append(arrQH(i) & vbTab & arrJH_S(i) & vbTab & t.ToString & vbTab & tp.ToString & vbCrLf)
            tp = 0
            m = 0
        Next
        TextBox1.Text = sb.ToString.Trim
    End Sub
    Function tj_xingtaicount(start_Index As Integer, end_Index As Integer, xt As String) As Integer
        Dim t As Integer = 0
        Select Case xt
            Case "大"
                For i = start_Index To end_Index
                    For j = 0 To 4
                        If pd_xt(arrJH_sep_I(i, j), xt) = True Then
                            t = t + 1
                        End If
                    Next
                Next

        End Select
        Return t
    End Function
    Function pd_xt(tp As Integer, xt As String) As Boolean
        Dim zb As String = ""
        Select Case xt
            Case "大"
                zb = "56789"
                If zb.IndexOf(tp.ToString) >= 0 Then
                    Return True
                Else
                    Return False
                End If
        End Select
    End Function

    Private Sub w0005_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
End Class